﻿// ParseLib - An open source library for natural language processing.
// Copyright (C) Kais Dukes, 2012. E-mail: kais@kaisdukes.com
// http://parselib.org

using System.Collections.Generic;
using ParseLib.Corpora;

namespace ParseLib.Treebanks
{
    public class SyntaxGraph : TextualUnit
    {
        private readonly List<ISyntaxNode> _nodes = new List<ISyntaxNode>();

        public SyntaxGraph(ICorpus corpus)
            : base(corpus)
        {
        }

        public void AddNode(ISyntaxNode node)
        {
            _nodes.Add(node);
        }

        public int NodeCount
        {
            get { return _nodes.Count; }
        }

        public IEnumerable<ISyntaxNode> Nodes
        {
            get { return _nodes; }
        }

        public ISyntaxNode GetNode(int index)
        {
            return _nodes[index];
        }
    }
}